package com.moli.iov.admin.service.impl;

import com.moli.iov.admin.model.vo.req.DictDataQueryByTypeVo;
import com.moli.iov.admin.service.DictDataService;
import com.moli.iov.base.model.dto.DictDataQueryByTypeDto;
import com.moli.iov.base.model.po.DictData;
import com.moli.iov.base.remote.IDictDataRemoteService;
import com.moli.iov.rest.RestResponse;
import com.moli.iov.util.CommonUtils;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * @author whl
 */
@Service
@Slf4j
public class DictDataServiceImpl implements DictDataService {

  @Reference(group = "${service.group}", check = false)
  private IDictDataRemoteService iDictDataRemoteService;


  @Override
  public RestResponse<Map<String, List<DictData>>> listDictTreeByType(
      DictDataQueryByTypeVo dictDataQueryByTypeVo) {
    log.info("dictDataQueryByTypeVo:{}"+dictDataQueryByTypeVo);
    DictDataQueryByTypeDto dictDataQueryByTypeDto = new DictDataQueryByTypeDto();
    CommonUtils.copyProperties(dictDataQueryByTypeVo, dictDataQueryByTypeDto);
    return iDictDataRemoteService.queryBasicDicinfos(dictDataQueryByTypeDto);
  }
}
